home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / nwtp06 / tvlm.pas < prev    next >
Pascal/Delphi Source File  |  1996-07-10  |  3KB  |  83 lines

  1. program tvlm;
  2. {$F+}
  3.  
  4. { Example for the nwIntr unit / NwTP 0.6 (c) 1995, R.Spronk
  5.  
  6.   Shows the same information as the VLM /X command.
  7.  
  8.   Example for the use of the GetVLMHeader and GetVLMControlBlock
  9.   functions in the unit nwIntr }
  10.  
  11. uses dos,nwintr,nwmisc;
  12.  
  13. Var t:byte;
  14.     HDR:TVLMHeader;
  15.     CBL:TVLMcontrolBlockEntry;
  16.     s:string;
  17.     GlobSize,TransSize:longint;
  18.     regs:registers;
  19.     w:word;
  20.  
  21. begin
  22. IF NOT VLM_EXE_Loaded
  23.  then begin
  24.       writeln('VLM.EXE not loaded.');
  25.       halt(0);
  26.       end;
  27. GetVLMHeader(HDR);
  28.  
  29. regs.ax:=$7a20;
  30. regs.bx:=$0000;
  31. regs.cx:=$0000;
  32. intr($2f,regs);
  33.  
  34. writeln('Handler entry point  : ',HexStr(regs.es,4),':',HexStr(regs.bx,4));
  35. writeln('Headerlength (or id?): ',HexStr(HDR.headerlen,2),'h');
  36. writeln('IDstring             : ',hdr.multiplexIdString[1],
  37.                      hdr.multiplexIdString[2],
  38.                      hdr.multiplexIdString[3]);
  39.  
  40. writeln('TransientSwitchCount : ',hdr.TransientSwitchCount);
  41. writeln('CallCount            : ',hdr.CallCount);
  42. writeln('CurrentVLMid         : ',HexStr(hdr.CurrentVLMID,4),'h');
  43. writeln('MemoryType           : ',HexStr(hdr.MemoryType,2),'h [04 = XMS]');
  44. writeln('ModulesLoaded        : ',hdr.ModulesLoaded);
  45. writeln('BlockID              : ',HexStr(hdr.BlockId,4),'h');
  46. writeln('TransientBlock       : ',HexStr(hdr.TransientBlock,4),'h');
  47. writeln('GlobalSegment        : ',HexStr(hdr.GlobalSegment,4),'h');
  48. writeln('FullMapCount         : ',hdr.FullMapCount);
  49.  
  50. GlobSize:=0;TransSize:=0;
  51. writeln;
  52. writeln('VLM control block information               Address   Memory size (bytes) ');
  53. writeln('Name     ID   Flag Func Maps Call TSeg Gseg Low  Hi   TSize  Gsize  SSize ');
  54. writeln('-------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ ------ ------');
  55. for t:=0 to hdr.modulesLoaded
  56.  do begin
  57.     GetVLMcontrolBlock(t,CBL);
  58.  
  59.     With CBL
  60.      do begin
  61.         s[0]:=#8;
  62.         move(cbl.VLMname,s[1],8);
  63.         write(s,' ');
  64.  
  65.         write(HexStr(id,4),' ');
  66.         write(HexStr(Flag,4),' ');
  67.         write(HexStr(Func,4),' ');
  68.         write(HexStr(Maps,4),' ');
  69.         write(HexStr(TimesCalled,4),' ');
  70.         write(HexStr(TransientSeg,4),' ');
  71.         write(HexStr(GlobalSeg,4),' ');
  72.         write(HexStr(AddressLow,4),' ');
  73.         write(HexStr(AddressHi,4),' ');
  74.         writeln(16*TsegSize:6,' ',16*GSegSize:6,' ',16*SSegSize:6);
  75.         if TsegSize>TransSize
  76.          then TransSize:=TsegSize;
  77.         GlobSize:=GlobSize+GSegSize;
  78.         end;
  79.     end;
  80. writeln('Transient block size: ',TransSize*16);
  81. writeln('Global segment size : ',GlobSize*16);
  82.  
  83. end.